package com.cci.kangdao.dao;

import com.cci.kangdao.model.WorkOrderInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;
import java.util.Map;

/**
 *
 */
@MapperScan
public interface WorkOrderOperatorRelationDao {

    @Select("select top 1 * from WorkOrderOperatorRelation_T where Flag = 0 and OrderId = #{orderId} order by ID desc")
    Map<String,Object> getOperatorByOrderId(@Param("orderId") Long orderId);

    // 插入OperatorRelation数据
    public int insertOperatorRelationInfo(Map<String,Object> map);
    
    @Select("select top 1 orderId, orderStatus, userId, name, phone from WorkOrderOperatorRelation_T where Flag = 0 and OrderId = #{orderId} order by ID desc")
    Map<String, Object> getOperatorUserIdByOrderId(@Param("orderId") Long orderId);

    List<WorkOrderInfo> getOperatorByOrderIdList(@Param("orderIdList") List<Long> orderIdList);

}
